#include <iostream>
#define SIZE 50

using namespace std;

void read();

char word[SIZE];
int n;

int main()
{
	int ok = 1, i, j;
	read();
	
	for (i = 0, j = n -1; i < n, j >= 0; ++i, --j)
		if(word[i] != word[j])
			ok = 0;
			
	cout << ok;
		
	return 0;
}

void read()
{
	int i;
	cout << "n = ";
	cin >> n;
	
	for (i = 0; i < n; ++i)
	{	
		cout << "word[" << i << "]= ";
		cin >> word[i];
	}
}